package de.jmda.util.gui.awt.graphics;


import static org.junit.Assert.assertEquals;

import java.awt.Point;

import org.junit.Test;

import de.jmda.util.gui.awt.graphics.Compass.Direction;

public class JUTCompass
{
	@Test
	public void test_10_10_10_10()
	{
		Point source = new Point(10, 10);
		Point target = new Point(10, 10);
		
		assertEquals(Direction.NONE, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_10_10_9_9()
	{
		Point source = new Point(10, 10);
		Point target = new Point( 9,  9);
		
		assertEquals(Direction.NORTH, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_10_10_10_9()
	{
		Point source = new Point(10, 10);
		Point target = new Point(10,  9);
		
		assertEquals(Direction.NORTH, Compass.getDirection(source, target));
	}

	@Test
	public void test_10_10_11_9()
	{
		Point source = new Point(10, 10);
		Point target = new Point(11,  9);
		
		assertEquals(Direction.EAST, Compass.getDirection(source, target));
	}

	@Test
	public void test_10_10_11_10()
	{
		Point source = new Point(10, 10);
		Point target = new Point(11, 10);
		
		assertEquals(Direction.EAST, Compass.getDirection(source, target));
	}

	@Test
	public void test_10_10_11_11()
	{
		Point source = new Point(10, 10);
		Point target = new Point(11, 11);
		
		assertEquals(Direction.SOUTH, Compass.getDirection(source, target));
	}

	@Test
	public void test_10_10_10_11()
	{
		Point source = new Point(10, 10);
		Point target = new Point(10, 11);
		
		assertEquals(Direction.SOUTH, Compass.getDirection(source, target));
	}

	@Test
	public void test_10_10_9_11()
	{
		Point source = new Point(10, 10);
		Point target = new Point( 9, 11);

		assertEquals(Direction.WEST, Compass.getDirection(source, target));
	}

	@Test
	public void test_10_10_9_10()
	{
		Point source = new Point(10, 10);
		Point target = new Point( 9, 10);

		assertEquals(Direction.WEST, Compass.getDirection(source, target));
	}

	@Test
	public void test_9_10_9_10()
	{
		Point source = new Point( 9, 10);
		Point target = new Point( 9, 10);
		
		assertEquals(Direction.NONE, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_9_10_8_9()
	{
		Point source = new Point( 9, 10);
		Point target = new Point( 8,  9);
		
		assertEquals(Direction.NORTH, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_9_10_9_9()
	{
		Point source = new Point( 9, 10);
		Point target = new Point( 9,  9);
		
		assertEquals(Direction.NORTH, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_9_10_10_9()
	{
		Point source = new Point( 9, 10);
		Point target = new Point(10,  9);
		
		assertEquals(Direction.EAST, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_9_10_10_10()
	{
		Point source = new Point( 9, 10);
		Point target = new Point(10, 10);
		
		assertEquals(Direction.EAST, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_9_10_10_11()
	{
		Point source = new Point( 9, 10);
		Point target = new Point(10, 11);
		
		assertEquals(Direction.SOUTH, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_9_10_9_11()
	{
		Point source = new Point( 9, 10);
		Point target = new Point( 9, 11);
		
		assertEquals(Direction.SOUTH, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_9_10_8_11()
	{
		Point source = new Point( 9, 10);
		Point target = new Point( 8, 11);

		assertEquals(Direction.WEST, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_9_10_8_10()
	{
		Point source = new Point( 9, 10);
		Point target = new Point( 8, 10);
	
		assertEquals(Direction.WEST, Compass.getDirection(source, target));
	}

	@Test
	public void test_11_10_11_10()
	{
		Point source = new Point(11, 10);
		Point target = new Point(11, 10);
		
		assertEquals(Direction.NONE, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_11_10_10_9()
	{
		Point source = new Point(11, 10);
		Point target = new Point(10,  9);
		
		assertEquals(Direction.NORTH, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_11_10_11_9()
	{
		Point source = new Point(11, 10);
		Point target = new Point(11,  9);
		
		assertEquals(Direction.NORTH, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_11_10_12_9()
	{
		Point source = new Point(11, 10);
		Point target = new Point(12,  9);
		
		assertEquals(Direction.EAST, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_11_10_12_10()
	{
		Point source = new Point(11, 10);
		Point target = new Point(12, 10);
		
		assertEquals(Direction.EAST, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_11_10_12_11()
	{
		Point source = new Point(11, 10);
		Point target = new Point(12, 11);
		
		assertEquals(Direction.SOUTH, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_11_10_11_11()
	{
		Point source = new Point(11, 10);
		Point target = new Point(11, 11);
		
		assertEquals(Direction.SOUTH, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_11_10_10_11()
	{
		Point source = new Point(11, 10);
		Point target = new Point(10, 11);
	
		assertEquals(Direction.WEST, Compass.getDirection(source, target));
	}
	
	@Test
	public void test_11_10_10_10()
	{
		Point source = new Point(11, 10);
		Point target = new Point(10, 10);
	
		assertEquals(Direction.WEST, Compass.getDirection(source, target));
	}
}